﻿using System;

namespace HW
{
    class Program
    {
        static void Main(string[] args)
        {
            // generate random array and calculate negative values count
            Random random = new Random();
            int n = 1000000;
            double[] array = new double[n];

            int positive = 0;
            int negative = 0;
            int zero = 0;

            for (int i = 0; i < n; i++)
            {
                array[i] = (random.NextDouble() * 2 - 1);

                if (array[i] > 0)
                {
                    positive++;
                }

                if (array[i] < 0)
                {
                    negative++;
                }
            }

            Console.WriteLine("Negative = " + negative + " | " + 100.0 * negative / n + "%");
            Console.WriteLine("Positive = " + positive + " | " + 100.0 * positive / n + "%");
            zero = n - positive - negative;
            Console.WriteLine("Zero = " + zero + " | " + 100.0 * zero / n);

            Console.ReadKey();
        }
    }
}
